package day_05;

import java.util.Scanner;

/**
 * @ClassName Test01
 * @Description TODO
 * @Author hp
 * @Date 2021/6/8 10:46
 * @Version 1.0
 **/
public class Test01 {
    public static void main(String[] args) {
        System.out.println("请输入小组的人数:");
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        String[] strings = new String[count];
        double[] doules = new double[count];
        int maxIndex = 0;
        for (int i = 0; i < count; i++) {
            System.out.print("请输入第" + (i + 1) + "个人的名字:");
            strings[i] = scanner.next();
            System.out.print("请输入第" + (i + 1) + "个人的成绩:");
            doules[i] = scanner.nextDouble();
            System.out.println();
        }
        for (int i = 0; i <count ; i++) {
            if(doules[maxIndex]<doules[i]){
                maxIndex = i;
            }
        }
        System.out.println(strings[maxIndex]+"获得了最高分"+doules[maxIndex]);

    }
}
